package conf

import (
	"github.com/spf13/viper"
)

func MustLoad(path string, c interface{}) {
	var err error
	v := viper.New()
	v.SetConfigFile(path)
	v.SetConfigType("yaml")
	err = v.ReadInConfig()
	if err != nil {
		panic(err)
	}

	if err = v.Unmarshal(c); err != nil {
		panic(err)
	}
}
